<?php
	
	/**
	 * Verifies bootstrapper execution to ensure file
	 * necessities, and disabling direct access
	 */
	defined('ENGINE') or exit;
	
	/**
	 * Shutdown handler
	 *
	 * @return      void    No value is returned
	 */
	function engine_shutdown_handler()
	{
		$errors = Engine::globals('errors');
		
		if(!DEBUG || (!$errors || !count($errors)))
		{
			return;
		}
		
		global $engine;
		
		$buffer = '';
		
		foreach($errors as $error)
		{
			$buffer .= $error . '<br />';
		}
		
		Engine::globals('errors', new ArrayObject);
		
		engine_doc_error($buffer);
	}

?>